package com.hziee.cosmanage.member.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.hziee.cosmanage.member.entity.PerormanceEntity;
import com.hziee.cosmanage.member.service.PerormanceService;
import com.hziee.common.utils.PageUtils;
import com.hziee.common.utils.R;



/**
 * 
 *
 * @author yb
 * @email yangbin@gmail.com
 * @date 2021-02-02 22:48:30
 */
@RestController
@RequestMapping("member/perormance")
public class PerormanceController {
    @Autowired
    private PerormanceService perormanceService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("member:perormance:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = perormanceService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{perormanceId}")
    //@RequiresPermissions("member:perormance:info")
    public R info(@PathVariable("perormanceId") Integer perormanceId){
		PerormanceEntity perormance = perormanceService.getById(perormanceId);

        return R.ok().put("perormance", perormance);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("member:perormance:save")
    public R save(@RequestBody PerormanceEntity perormance){
		perormanceService.save(perormance);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
   // @RequiresPermissions("member:perormance:update")
    public R update(@RequestBody PerormanceEntity perormance){
		perormanceService.updateById(perormance);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("member:perormance:delete")
    public R delete(@RequestBody Integer[] perormanceIds){
		perormanceService.removeByIds(Arrays.asList(perormanceIds));

        return R.ok();
    }

}
